//
//  UIWindow+MLKit.m
//  Pods
//
//  Created by molon on 15/7/31.
//
//

#import "UIWindow+MLKit.h"

@implementation UIWindow (MLKit)

+ (UIWindow*)currentNormalWindow
{
//    return [UIApplication sharedApplication].delegate.window;
    
    NSEnumerator *frontToBackWindows = [[[UIApplication sharedApplication]windows] reverseObjectEnumerator];
    UIScreen *mainScreen = [UIScreen mainScreen];
    
    for (UIWindow *window in frontToBackWindows) {
        if (window.screen == mainScreen && window.windowLevel == UIWindowLevelNormal && !window.hidden) {
            return window;
        }
    }
    return nil;
}

@end
